package net.uhuijia.user.usertoken.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import net.uhuijia.appbase.service.BaseService;
import net.uhuijia.user.usermall.persistence.model.UserMall;
import net.uhuijia.user.usertoken.persistence.model.UserToken;
import net.uhuijia.user.usertoken.persistence.model.UserTokenExample;


@Service
@Transactional
public interface UserTokenService
     extends BaseService<UserToken,UserTokenExample> {
	
	/**
	 * 验证 token秘 device 如果成功则返回用户信息，如果失败返回空
	 * @param device
	 * @param token
	 * @return
	 */
	UserMall auth(String device, String token);



	/**
	 * 根据用户信息返回token
	 * @param user
	 * @return TokenReturnVo
	 * @author 许小宝
	 */
	UserToken createToken(UserMall user,String device);
}